/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.mapper;

import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.dto.BuildingUserDTO;
import org.springblade.modules.admin.dto.building.BuildingUserElevatorDTO;
import org.springblade.modules.admin.entity.BuildingUser;
import org.springblade.modules.admin.entity.MaintainPlanConfig;
import org.springblade.modules.admin.vo.BuildingUserVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.admin.vo.ElevatorDossierVO;
import org.springblade.modules.admin.vo.ProjectVO;
import org.springblade.modules.admin.vo.building.BuildingUserElevatorDetailVo;
import org.springblade.modules.admin.vo.building.BuildingUserPageVo;

import java.util.List;

/**
 * 项目使用单位 Mapper 接口
 *
 * @author ysq
 * @since 2023-08-09
 */
public interface BuildingUserMapper extends BaseMapper<BuildingUser> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param buildingUser
	 * @return
	 */
	List<BuildingUserVO> selectBuildingUserPage(IPage page, @Param("buildingUser") BuildingUserDTO buildingUser);


	/**
	 * 使用单位的项目信息
	 *
	 * @param page
	 * @param buildingUserDTO
	 * @return
	 */
	List<ProjectVO> buildDingList(IPage<ProjectVO> page, @Param("buildingUser") BuildingUserDTO buildingUserDTO);

	/**
	 * 使用单位的电梯信息
	 *
	 * @param page
	 * @param buildingUserDTO
	 * @return
	 */
	List<ElevatorDossierVO> elevatorList(IPage<ElevatorDossierVO> page, @Param("buildingUser") BuildingUserDTO buildingUserDTO);

	List<BuildingUser> selectBuildingUserList(@Param("buildingUser") BuildingUser buildingUser);


	/**
	 * 客户单位的统计信息
	 * @param id 客户单位id
	 * @param timeType 1:开启暂停维保 0 不开启
	 * @return 数据集
	 */
	List<MaintainPlanConfig> getBuildingUserStatus(@Param("id") Long id, @Param("timeType") Integer timeType);

	/**
	 * 客户单位 v2版本，分页
	 *
	 * @param page            分页
	 * @param buildingUserDTO 查询条件
	 * @return 数据集
	 */
	List<BuildingUserPageVo> pageV2(IPage<BuildingUserPageVo> page, @Param("buildingUserDTO") BuildingUserDTO buildingUserDTO);

	/**
	 * 客户单位 v2版本，电梯信息
	 *
	 * @param page            分页
	 * @param buildingUserDTO 筛选条件
	 * @return 数据集
	 */
	List<BuildingUserElevatorDetailVo> elevatorListV2(@Param("page") IPage<BuildingUserElevatorDetailVo> page, @Param("buildingUserDTO") BuildingUserElevatorDTO buildingUserDTO);
}
